<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets">
    
    <h:head>
        <meta charset="utf-8"/>
        <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
        <meta name="viewport" content="width=device-width, initial-scale=1"/>
        <title>Inscription</title>
        <h:outputStylesheet name="css/signin.css"/>
        <h:outputStylesheet name="css/bootstrap.min.css"/>
    </h:head>
    
    <h:body>
        <ui:composition template="/template/originLayout.xhtml">
             <ui:define name ="content">
        <ui:composition template="./originLayout.xhtml">
            <ui:define name="content">
                <div class="container">
                    <h:form class="form-signin">
                        <h2 class="form-signin-heading">Inscrivez vous</h2>
                        <h:outputLabel value="Nom"/> <br/>
                        <h:inputText  id="nom" class="form-control" requiredMessage="nom" value="#{serviceUser.user.nom}"/><br/>
                        <h:outputLabel value="Prenom"/> <br/>
                        <h:inputText  id="prenom" class="form-control" requiredMessage="prenom" value="#{serviceUser.user.prenom}"/><br/>
                        <h:outputLabel value="Adresse Email"/> <br/>
                        <h:inputText  id="email" class="form-control" requiredMessage="email" value="#{serviceUser.user.email}"/><br/>
                        <h:outputLabel value="Password"/> <br/>
                        <h:inputSecret class="form-control" value="#{serviceUser.user.password}"/><br/>
                        <h:outputLabel value="Etablissement"/> <br/>
                        <h:selectOneMenu class="form-control" value="#{serviceUser.user.nomEtablissement}">     //Le choix est en dur pour l'instant, il sera récupéré dans la BDD
                            <f:selectItem itemValue="école" itemLabel="ville1 - école" />
                            <f:selectItem itemValue="collège" itemLabel="ville1 - collège" />
                            <f:selectItem itemValue="lycée" itemLabel="ville1 - lycée" />
                        </h:selectOneMenu><br/>
                        <h:outputLabel value="Etes-vous professeur?"/> <br/>
                        <h:selectBooleanCheckbox class="form-control" value="#{serviceUser.user.droit}"/><br/>
                        <h:commandButton class="btn btn-lg btn-primary btn-block" action="#{serviceClient.save()}"/>    //doit renvoyer "save ok" si reussi sinon "save ko"
                    </h:form>
                </div> 
            </ui:define>
        </ui:composition>
    </h:body>
</html>